3.887 \(\int \frac {d+e x}{x^2 (a+b x+c x^2)} \, dx\)

Optimal. Leaf size=104 \[ -\frac {\left (-a b e-2 a c d+b^2 d\right ) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{a^2 \sqrt {b^2-4 a c}}+\frac {(b d-a e) \log \left (a+b x+c x^2\right )}{2 a^2}-\frac {\log (x) (b d-a e)}{a^2}-\frac {d}{a x} \]

[Out]

-d/a/x-(-a*e+b*d)*ln(x)/a^2+1/2*(-a*e+b*d)*ln(c*x^2+b*x+a)/a^2-(-a*b*e-2*a*c*d+b^2*d)*arctanh((2*c*x+b)/(-4*a*
c+b^2)^(1/2))/a^2/(-4*a*c+b^2)^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.15, antiderivative size = 104, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {800, 634, 618, 206, 628} \[ -\frac {\left (-a b e-2 a c d+b^2 d\right ) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{a^2 \sqrt {b^2-4 a c}}+\frac {(b d-a e) \log \left (a+b x+c x^2\right )}{2 a^2}-\frac {\log (x) (b d-a e)}{a^2}-\frac {d}{a x} \]

Antiderivative was successfully verified.

[In]

Int[(d + e*x)/(x^2*(a + b*x + c*x^2)),x]

[Out]

-(d/(a*x)) - ((b^2*d - 2*a*c*d - a*b*e)*ArcTanh[(b + 2*c*x)/Sqrt[b^2 - 4*a*c]])/(a^2*Sqrt[b^2 - 4*a*c]) - ((b*
d - a*e)*Log[x])/a^2 + ((b*d - a*e)*Log[a + b*x + c*x^2])/(2*a^2)

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 628

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(d*Log[RemoveContent[a + b*x +
c*x^2, x]])/b, x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rule 634

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 800

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Int[Exp
andIntegrand[((d + e*x)^m*(f + g*x))/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && NeQ[b^2 -
 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && IntegerQ[m]

Rubi steps

\begin {align*} \int \frac {d+e x}{x^2 \left (a+b x+c x^2\right )} \, dx &=\int \left (\frac {d}{a x^2}+\frac {-b d+a e}{a^2 x}+\frac {b^2 d-a c d-a b e+c (b d-a e) x}{a^2 \left (a+b x+c x^2\right )}\right ) \, dx\\ &=-\frac {d}{a x}-\frac {(b d-a e) \log (x)}{a^2}+\frac {\int \frac {b^2 d-a c d-a b e+c (b d-a e) x}{a+b x+c x^2} \, dx}{a^2}\\ &=-\frac {d}{a x}-\frac {(b d-a e) \log (x)}{a^2}+\frac {(b d-a e) \int \frac {b+2 c x}{a+b x+c x^2} \, dx}{2 a^2}+\frac {\left (b^2 d-2 a c d-a b e\right ) \int \frac {1}{a+b x+c x^2} \, dx}{2 a^2}\\ &=-\frac {d}{a x}-\frac {(b d-a e) \log (x)}{a^2}+\frac {(b d-a e) \log \left (a+b x+c x^2\right )}{2 a^2}-\frac {\left (b^2 d-2 a c d-a b e\right ) \operatorname {Subst}\left (\int \frac {1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{a^2}\\ &=-\frac {d}{a x}-\frac {\left (b^2 d-2 a c d-a b e\right ) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{a^2 \sqrt {b^2-4 a c}}-\frac {(b d-a e) \log (x)}{a^2}+\frac {(b d-a e) \log \left (a+b x+c x^2\right )}{2 a^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.08, size = 100, normalized size = 0.96 \[ \frac {\frac {2 \left (-a b e-2 a c d+b^2 d\right ) \tan ^{-1}\left (\frac {b+2 c x}{\sqrt {4 a c-b^2}}\right )}{\sqrt {4 a c-b^2}}+(b d-a e) \log (a+x (b+c x))+2 \log (x) (a e-b d)-\frac {2 a d}{x}}{2 a^2} \]

Antiderivative was successfully verified.

[In]

Integrate[(d + e*x)/(x^2*(a + b*x + c*x^2)),x]

[Out]

((-2*a*d)/x + (2*(b^2*d - 2*a*c*d - a*b*e)*ArcTan[(b + 2*c*x)/Sqrt[-b^2 + 4*a*c]])/Sqrt[-b^2 + 4*a*c] + 2*(-(b
*d) + a*e)*Log[x] + (b*d - a*e)*Log[a + x*(b + c*x)])/(2*a^2)

________________________________________________________________________________________

fricas [A]  time = 1.37, size = 361, normalized size = 3.47 \[ \left [\frac {{\left (a b e - {\left (b^{2} - 2 \, a c\right )} d\right )} \sqrt {b^{2} - 4 \, a c} x \log \left (\frac {2 \, c^{2} x^{2} + 2 \, b c x + b^{2} - 2 \, a c + \sqrt {b^{2} - 4 \, a c} {\left (2 \, c x + b\right )}}{c x^{2} + b x + a}\right ) + {\left ({\left (b^{3} - 4 \, a b c\right )} d - {\left (a b^{2} - 4 \, a^{2} c\right )} e\right )} x \log \left (c x^{2} + b x + a\right ) - 2 \, {\left ({\left (b^{3} - 4 \, a b c\right )} d - {\left (a b^{2} - 4 \, a^{2} c\right )} e\right )} x \log \relax (x) - 2 \, {\left (a b^{2} - 4 \, a^{2} c\right )} d}{2 \, {\left (a^{2} b^{2} - 4 \, a^{3} c\right )} x}, \frac {2 \, {\left (a b e - {\left (b^{2} - 2 \, a c\right )} d\right )} \sqrt {-b^{2} + 4 \, a c} x \arctan \left (-\frac {\sqrt {-b^{2} + 4 \, a c} {\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) + {\left ({\left (b^{3} - 4 \, a b c\right )} d - {\left (a b^{2} - 4 \, a^{2} c\right )} e\right )} x \log \left (c x^{2} + b x + a\right ) - 2 \, {\left ({\left (b^{3} - 4 \, a b c\right )} d - {\left (a b^{2} - 4 \, a^{2} c\right )} e\right )} x \log \relax (x) - 2 \, {\left (a b^{2} - 4 \, a^{2} c\right )} d}{2 \, {\left (a^{2} b^{2} - 4 \, a^{3} c\right )} x}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)/x^2/(c*x^2+b*x+a),x, algorithm="fricas")

[Out]

[1/2*((a*b*e - (b^2 - 2*a*c)*d)*sqrt(b^2 - 4*a*c)*x*log((2*c^2*x^2 + 2*b*c*x + b^2 - 2*a*c + sqrt(b^2 - 4*a*c)
*(2*c*x + b))/(c*x^2 + b*x + a)) + ((b^3 - 4*a*b*c)*d - (a*b^2 - 4*a^2*c)*e)*x*log(c*x^2 + b*x + a) - 2*((b^3
- 4*a*b*c)*d - (a*b^2 - 4*a^2*c)*e)*x*log(x) - 2*(a*b^2 - 4*a^2*c)*d)/((a^2*b^2 - 4*a^3*c)*x), 1/2*(2*(a*b*e -
 (b^2 - 2*a*c)*d)*sqrt(-b^2 + 4*a*c)*x*arctan(-sqrt(-b^2 + 4*a*c)*(2*c*x + b)/(b^2 - 4*a*c)) + ((b^3 - 4*a*b*c
)*d - (a*b^2 - 4*a^2*c)*e)*x*log(c*x^2 + b*x + a) - 2*((b^3 - 4*a*b*c)*d - (a*b^2 - 4*a^2*c)*e)*x*log(x) - 2*(
a*b^2 - 4*a^2*c)*d)/((a^2*b^2 - 4*a^3*c)*x)]

________________________________________________________________________________________

giac [A]  time = 0.15, size = 105, normalized size = 1.01 \[ \frac {{\left (b d - a e\right )} \log \left (c x^{2} + b x + a\right )}{2 \, a^{2}} - \frac {{\left (b d - a e\right )} \log \left ({\left | x \right |}\right )}{a^{2}} + \frac {{\left (b^{2} d - 2 \, a c d - a b e\right )} \arctan \left (\frac {2 \, c x + b}{\sqrt {-b^{2} + 4 \, a c}}\right )}{\sqrt {-b^{2} + 4 \, a c} a^{2}} - \frac {d}{a x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)/x^2/(c*x^2+b*x+a),x, algorithm="giac")

[Out]

1/2*(b*d - a*e)*log(c*x^2 + b*x + a)/a^2 - (b*d - a*e)*log(abs(x))/a^2 + (b^2*d - 2*a*c*d - a*b*e)*arctan((2*c
*x + b)/sqrt(-b^2 + 4*a*c))/(sqrt(-b^2 + 4*a*c)*a^2) - d/(a*x)

________________________________________________________________________________________

maple [A]  time = 0.06, size = 180, normalized size = 1.73 \[ -\frac {b e \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}\, a}-\frac {2 c d \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}\, a}+\frac {b^{2} d \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}\, a^{2}}+\frac {e \ln \relax (x )}{a}-\frac {e \ln \left (c \,x^{2}+b x +a \right )}{2 a}-\frac {b d \ln \relax (x )}{a^{2}}+\frac {b d \ln \left (c \,x^{2}+b x +a \right )}{2 a^{2}}-\frac {d}{a x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((e*x+d)/x^2/(c*x^2+b*x+a),x)

[Out]

-1/2/a*ln(c*x^2+b*x+a)*e+1/2/a^2*ln(c*x^2+b*x+a)*b*d-1/a/(4*a*c-b^2)^(1/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))
*b*e-2/a/(4*a*c-b^2)^(1/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*c*d+1/a^2/(4*a*c-b^2)^(1/2)*arctan((2*c*x+b)/(4
*a*c-b^2)^(1/2))*b^2*d-1/a*d/x+1/a*e*ln(x)-1/a^2*ln(x)*b*d

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)/x^2/(c*x^2+b*x+a),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*a*c-b^2>0)', see `assume?` f
or more details)Is 4*a*c-b^2 positive or negative?

________________________________________________________________________________________

mupad [B]  time = 2.96, size = 791, normalized size = 7.61 \[ \frac {\ln \relax (x)\,\left (a\,e-b\,d\right )}{a^2}-\frac {d}{a\,x}+\frac {\ln \left (\frac {b\,c^2\,d^2-a\,c^2\,d\,e}{a^2}+\frac {\left (\frac {e\,a^2\,b\,c+d\,a^2\,c^2-d\,a\,b^2\,c}{a^2}+\frac {\left (\frac {x\,\left (6\,a^3\,c^2-2\,a^2\,b^2\,c\right )}{a^2}-a\,b\,c\right )\,\left (d\,{\left (b^2-4\,a\,c\right )}^{3/2}+b^2\,d\,\sqrt {b^2-4\,a\,c}-2\,a\,e\,\left (4\,a\,c-b^2\right )+2\,b\,d\,\left (4\,a\,c-b^2\right )-2\,a\,b\,e\,\sqrt {b^2-4\,a\,c}\right )}{16\,a^3\,c-4\,a^2\,b^2}+\frac {x\,\left (3\,a^2\,c^2\,e-2\,a\,b\,c^2\,d\right )}{a^2}\right )\,\left (d\,{\left (b^2-4\,a\,c\right )}^{3/2}+b^2\,d\,\sqrt {b^2-4\,a\,c}-2\,a\,e\,\left (4\,a\,c-b^2\right )+2\,b\,d\,\left (4\,a\,c-b^2\right )-2\,a\,b\,e\,\sqrt {b^2-4\,a\,c}\right )}{16\,a^3\,c-4\,a^2\,b^2}+\frac {c^3\,d^2\,x}{a^2}\right )\,\left (d\,{\left (b^2-4\,a\,c\right )}^{3/2}+b^2\,d\,\sqrt {b^2-4\,a\,c}-2\,a\,e\,\left (4\,a\,c-b^2\right )+2\,b\,d\,\left (4\,a\,c-b^2\right )-2\,a\,b\,e\,\sqrt {b^2-4\,a\,c}\right )}{16\,a^3\,c-4\,a^2\,b^2}-\frac {\ln \left (\frac {b\,c^2\,d^2-a\,c^2\,d\,e}{a^2}-\frac {\left (\frac {e\,a^2\,b\,c+d\,a^2\,c^2-d\,a\,b^2\,c}{a^2}-\frac {\left (\frac {x\,\left (6\,a^3\,c^2-2\,a^2\,b^2\,c\right )}{a^2}-a\,b\,c\right )\,\left (d\,{\left (b^2-4\,a\,c\right )}^{3/2}+b^2\,d\,\sqrt {b^2-4\,a\,c}+2\,a\,e\,\left (4\,a\,c-b^2\right )-2\,b\,d\,\left (4\,a\,c-b^2\right )-2\,a\,b\,e\,\sqrt {b^2-4\,a\,c}\right )}{16\,a^3\,c-4\,a^2\,b^2}+\frac {x\,\left (3\,a^2\,c^2\,e-2\,a\,b\,c^2\,d\right )}{a^2}\right )\,\left (d\,{\left (b^2-4\,a\,c\right )}^{3/2}+b^2\,d\,\sqrt {b^2-4\,a\,c}+2\,a\,e\,\left (4\,a\,c-b^2\right )-2\,b\,d\,\left (4\,a\,c-b^2\right )-2\,a\,b\,e\,\sqrt {b^2-4\,a\,c}\right )}{16\,a^3\,c-4\,a^2\,b^2}+\frac {c^3\,d^2\,x}{a^2}\right )\,\left (d\,{\left (b^2-4\,a\,c\right )}^{3/2}+b^2\,d\,\sqrt {b^2-4\,a\,c}+2\,a\,e\,\left (4\,a\,c-b^2\right )-2\,b\,d\,\left (4\,a\,c-b^2\right )-2\,a\,b\,e\,\sqrt {b^2-4\,a\,c}\right )}{16\,a^3\,c-4\,a^2\,b^2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d + e*x)/(x^2*(a + b*x + c*x^2)),x)

[Out]

(log(x)*(a*e - b*d))/a^2 - d/(a*x) + (log((b*c^2*d^2 - a*c^2*d*e)/a^2 + (((a^2*c^2*d - a*b^2*c*d + a^2*b*c*e)/
a^2 + (((x*(6*a^3*c^2 - 2*a^2*b^2*c))/a^2 - a*b*c)*(d*(b^2 - 4*a*c)^(3/2) + b^2*d*(b^2 - 4*a*c)^(1/2) - 2*a*e*
(4*a*c - b^2) + 2*b*d*(4*a*c - b^2) - 2*a*b*e*(b^2 - 4*a*c)^(1/2)))/(16*a^3*c - 4*a^2*b^2) + (x*(3*a^2*c^2*e -
 2*a*b*c^2*d))/a^2)*(d*(b^2 - 4*a*c)^(3/2) + b^2*d*(b^2 - 4*a*c)^(1/2) - 2*a*e*(4*a*c - b^2) + 2*b*d*(4*a*c -
b^2) - 2*a*b*e*(b^2 - 4*a*c)^(1/2)))/(16*a^3*c - 4*a^2*b^2) + (c^3*d^2*x)/a^2)*(d*(b^2 - 4*a*c)^(3/2) + b^2*d*
(b^2 - 4*a*c)^(1/2) - 2*a*e*(4*a*c - b^2) + 2*b*d*(4*a*c - b^2) - 2*a*b*e*(b^2 - 4*a*c)^(1/2)))/(16*a^3*c - 4*
a^2*b^2) - (log((b*c^2*d^2 - a*c^2*d*e)/a^2 - (((a^2*c^2*d - a*b^2*c*d + a^2*b*c*e)/a^2 - (((x*(6*a^3*c^2 - 2*
a^2*b^2*c))/a^2 - a*b*c)*(d*(b^2 - 4*a*c)^(3/2) + b^2*d*(b^2 - 4*a*c)^(1/2) + 2*a*e*(4*a*c - b^2) - 2*b*d*(4*a
*c - b^2) - 2*a*b*e*(b^2 - 4*a*c)^(1/2)))/(16*a^3*c - 4*a^2*b^2) + (x*(3*a^2*c^2*e - 2*a*b*c^2*d))/a^2)*(d*(b^
2 - 4*a*c)^(3/2) + b^2*d*(b^2 - 4*a*c)^(1/2) + 2*a*e*(4*a*c - b^2) - 2*b*d*(4*a*c - b^2) - 2*a*b*e*(b^2 - 4*a*
c)^(1/2)))/(16*a^3*c - 4*a^2*b^2) + (c^3*d^2*x)/a^2)*(d*(b^2 - 4*a*c)^(3/2) + b^2*d*(b^2 - 4*a*c)^(1/2) + 2*a*
e*(4*a*c - b^2) - 2*b*d*(4*a*c - b^2) - 2*a*b*e*(b^2 - 4*a*c)^(1/2)))/(16*a^3*c - 4*a^2*b^2)

________________________________________________________________________________________

sympy [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)/x**2/(c*x**2+b*x+a),x)

[Out]

Timed out

________________________________________________________________________________________